* Dickstein, Ho, and Mark (2023)
* Plot adjusted and unadjusted markups in STATA

*Preliminaries
cd ../..
global release = "release/adj_markups"
global build = "build/adj_markups" 

* Import dataset
import delimited "$build/combined_dat_adj.csv", bindquote(strict) clear

** Box plot using adjusted markups (including government transfers)
#delimit ;
graph box adjusted_medical_markup, 
	over(market2) 
	over(year)
	box(1, fcolor("white") lcolor("black")) box(2, color("black"))
	marker(1,mfcolor("white") mlcolor("black")) marker(2,mcolor("black"))
	xsize(2) ysize(2) legend(off)
	//legend(label(1 "Individual market") label(2 "Small group market") region(lstyle(none)))
	//ytitle("adjusted medical markup") ylab(0(0.5)4.0, gmax gmin)
	ytitle("adjusted medical markup") ylab(0.4(0.2)1.6, gmax gmin)
	yline(1,lcolor(gray))
	b1title("")
	asyvars
	graphregion(color(white))
; 
#delimit cr
graph export "$release/adj_medical_markup_axis04.eps", replace 

**********************
* For comparison purposes, plot unadjusted markups also on the carrier level

** Box plot using unadjusted markups 
#delimit ;
graph box medical_markup, 
	over(market2) 
	over(year)
	box(1, fcolor("white") lcolor("black")) box(2, color("black"))
	marker(1,mfcolor("white") mlcolor("black")) marker(2,mcolor("black"))
	xsize(2) ysize(2) legend(off)
	//legend(label(1 "Individual market") label(2 "Small group market") region(lstyle(none)))
	//ytitle("medical markup") ylab(0(0.5)4.0, gmax gmin)
	ytitle("medical markup") ylab(0.4(0.2)1.6, gmax gmin)
	yline(1,lcolor(gray))
	b1title("")
	asyvars
	graphregion(color(white))
; 
#delimit cr
graph export "$release/unadj_medical_markup_axis04.eps", replace 







